fix: create gh repo in Initialization that the rest of the application expects#939
Conversation
- add `GitHubCli.createRepository` to service and live layer - call it from `gitInit` in ws server after local repo initialization - cover behavior with ws server and GitHub CLI layer tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I don't think I would want this app making repos for me automatically tbh, I think the functionality might be worth adding as a popup that is triggered via the Git dropdown if no remote works but it's a little more complicated than just making a private repo by default and calling it a day. For example, if I'm using T3 Code for a work project, I need to make the repo under the org for my work rather than my personal account, and they also need to have the |
What Changed
Initialize Gitcreated only a local repo, so push/PR was broken until you manually created a GitHub repo and origin.Why
This fix is right because it makes the button create the complete state the app already assumes (local repo plus GitHub remote)
UI Changes
N/A
Checklist
Note
Create a private GitHub repo automatically during git init
WS_METHODS.gitInitwebsocket handler in wsServer.ts now callsgitHubCli.createRepositorywithvisibility: 'private'aftergit.initRepo, tying the response to the repository creation result.createRepositoryto theGitHubCliservice interface and layer, invokinggh repo create --source=. --private --remote origin.GitHubCliLiveis added to the top-level layer in serverLayers.ts so it is available across the server runtime.gitInitnow fails ifgh repo createfails, and a private GitHub remote repo is always created on every local repo init.Macroscope summarized ec79ce1.